package com.sky.mapper;

import com.sky.entity.DishFlavor;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DishFlavorMapper {

    /**
     * @description: 批量保存菜品口味信息
     * @author: tanbobin
     * @date: 2024/5/30 17:10
     * @param:
     * @param flavors
     * @return:
     **/
    void insertBatch(List<DishFlavor> flavors);


    /**
     * @description: // 根据菜品 id 批量删除口味信息
     * @author: tanbobin
     * @date: 2024/5/31 15:17
     * @param:
     * @param ids
     * @return:
     **/
    void deleteByDishIds(List<Long> ids);

    /**
     * @description: 根据菜品 id 查询口味信息
     * @author: tanbobin
     * @date: 2024/5/31 16:04
     * @param:
     * @param id
     * @return:
     * @return com.sky.entity.DishFlavor
     **/
    @Select("select * from dish_flavor where dish_id = #{id}")
    List<DishFlavor> getDishFlavorInfo(Long id);

    /**
     * @description: 修改菜品口味信息
     * @author: tanbobin
     * @date: 2024/5/31 16:35
     * @param:
     * @param id
     * @return:
     **/
    void updateDishFlavor(Long id);
}
